<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>获得返回值num</title>
    <script>
        var foo = function(x, y) {
            return x - y;
        };

        function foo(x, y) { // foo(x,y);{坏习惯，报错后记得找错写分号
            return x + y;
        }
        var num = foo(1, 2);
        console.log(num); //输出为：－1
    </script>
</head>

<body>

</body>

</html>